package org.ch02.job.test;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * @author XCH
 * @date 2025 - 03 - 17
 */
public class Maintest {
    public static void main(String[] args) throws Exception {
        Class<?> clazz = Class.forName("org.ch02.test.Student");
        Constructor<?> constructor = clazz.getDeclaredConstructor();
        Object obj = constructor.newInstance();
        Student stu = (Student) obj;
        stu.sayHello("张三");
    }
}
